Skip to content

fix: stop sending the gateway metadata request header - #50

Draft
steve-calvert-glean wants to merge 1 commit into
mainfrom
fix/drop-gateway-metadata-header
Draft

steve-calvert-glean wants to merge 1 commit into
mainfrom
fix/drop-gateway-metadata-header

Conversation

@steve-calvert-glean

Copy link
Copy Markdown
Contributor

Problem

The plugin's local server sends X-Glean-Gateway-Request-Metadata on every request to Glean. Glean reads that header only on requests from its own services. The plugin stopped identifying as one in 3.6.0, so the header has had no effect since then.

It is also an internal header. Glean's edge can reject a request from outside that carries one. #41 removed the other internal headers for the same reason.

Change

  • Remove the header from the transport.
  • Remove buildGatewayMetadataHeader and its hand-written encoder.
  • Remove the chatSessionId parameter of createRemoteClient. It existed only to fill the header.
  • The header test now asserts that no request header starts with X-Glean-. Before, it asserted that this header was present.

No behavior changes for users. This applies to Claude Code, Cursor, and Codex, because all three use the same local server.

Verification

  • The new header assertion fails on main: expected [ 'x-glean-gateway-request-metadata' ] to deeply equal []. It passes with this change.
  • npm run typecheck:bundle passes.
  • npm run test:bundle passes: 24 files, 430 tests.
  • npm test builds and validates the claude, cursor, and codex outputs.
  • No built bundle under dist/ contains the string x-glean-.

Not verified: a live request to a Glean deployment with the built plugin.

The plugin's local server sent X-Glean-Gateway-Request-Metadata on every
request to Glean. Glean reads that header only on requests from its own
services, and the plugin stopped identifying as one in 3.6.0, so the header
has had no effect since then. It is also an internal header, which Glean's
edge can reject on a request from outside.

Remove the header, the hand-written encoder that built it, and the
chatSessionId parameter that existed only to fill it. The header test now
asserts that no request header starts with X-Glean-.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant